<template>
    <div>
        <h2>学生姓名：{{name}}</h2>
        <h2>学生年龄{{age}}</h2>
        <h2>{{objx.kk}}</h2>
        <h2>{{objx.kkv}}</h2>
        <button @click="sendMessage2">发送消息</button>
    </div>
</template>
<script>
import {ref,reactive} from 'vue'

export default {
    name:'Test',
    setup() {
        let name = ref('xfj')   
        let age = ref(10)
        let objx = ref({
            kk:'xxxx',
            kkv:'yyyy'
        })
        
        

        
        function sendMessage2(){
            name.value = 'xiaoming'
            age.value = 20
            objx.value.kk = 'xxxx2'
            objx.value.kkv = 'yyyy2'
            console.log(name,age)
        }

        return{
            name,
            age,
            sendMessage,
            sendMessage2,
            objx
        }
    }
}
</script>
<style>
    
</style>